﻿using AK56.Domain.Models;
using AK56.Domain.Services;
using AK56.Domain.Untils;
using AKCY.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Cors;
using System.Web.Http.Filters;

namespace AK56.APP.Application.Home.Controllers
{
    public class ConsoleController : ApiController
    {
        private IJOB_TransportOrderService transportOrderService;
        private IRpt_DeliverDailyService deliverDailyService;
        public ConsoleController(IJOB_TransportOrderService transportOrderService
            , IRpt_DeliverDailyService deliverDailyService
           )
        {
            this.transportOrderService = transportOrderService;
            this.deliverDailyService = deliverDailyService;
        }

        [HttpPost]
        public HttpResponseMessage GetFundsFlowlist(SearchModel searchModel)
        {
            var receivinglist = deliverDailyService.GetFundsFlowlist(searchModel);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = receivinglist });
        }

/**
 * 
 * 
 * **/



        [HttpPost]
        public HttpResponseMessage GetConsoleList(SearchModel searchModel)
        {
            var consoleList = transportOrderService.GetConsoleList(searchModel);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = consoleList });
        }

        [HttpPost]
        public HttpResponseMessage GetPaymentCollectionList(SearchModel searchModel)
        {
            var paymentCollectionList = transportOrderService.GetPaymentCollectionList(searchModel);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = paymentCollectionList });
        }

        [HttpPost]
        public HttpResponseMessage GetPaymentCollectionMulitiplyandAddList(DateTime time)
        {
            var paymentCollectionList = transportOrderService.GetPaymentCollectionMulitiplyandAddList(time);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = paymentCollectionList });
        }


        [HttpPost]
        public HttpResponseMessage GetVehiclelist(SearchModel searchModel)
        {
            var vehiclelist = transportOrderService.GetVehiclelist(searchModel);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = vehiclelist });
        }
        [HttpPost]
        public HttpResponseMessage GetVehiclelistMulitiplyandAddList(DateTime time)
        {
            var vehiclelist = transportOrderService.GetVehiclelistMulitiplyandAddList(time);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = vehiclelist });
        }

        [HttpPost]
        public HttpResponseMessage GetReceivinglist(SearchModel searchModel)
        {
            var receivinglist = transportOrderService.GetReceivinglist(searchModel);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = receivinglist });
        }
        [HttpPost]
        public HttpResponseMessage GetReceivingMulitiplyandAddList(DateTime time)
        {
            var receivinglist = transportOrderService.GetReceivingMulitiplyandAddList(time);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = receivinglist });
        }

       
        [HttpPost]
        public HttpResponseMessage GetFundsFlowMulitiplyandAddList(DateTime time)
        {
            var receivinglist = deliverDailyService.GetFundsFlowMulitiplyandAddList(time);
            return Request.CreateResponse(HttpStatusCode.OK, new { Data = receivinglist });
        }
    }
}
